home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
- #
- # setup lirc
- #
- # runlevels: geexbox, debug
-
- echo "### Starting LIRC daemon ###"
-
- # read the config
- if test -f /etc/remote; then
- . /etc/remote
- cp -f /etc/lirc/lircrc_$REMOTE /etc/lircrc
- cp -f /etc/lirc/lircd_$RECEIVER /etc/lircd
- cp -f /etc/lirc/lircd_$REMOTE.conf /etc/lircd.conf
- fi
- . /etc/lircd
-
- # insert needed modules
- IFS='|'
- for module in $LIRC_MODULES; do
- eval "modprobe $module" >/dev/null 2>&1
- done
-
- if [ $LIRC_DRIVER = "dev/input" ]; then
- EVENT=`cat /proc/bus/input/devices |grep -e ^[PH] |grep -e ^P:.*ir -A1|grep -e ^H:.*event|cut -d' ' -f3`
- LIRC_DEVICE=/dev/$EVENT
- fi
-
- # start lircd
- lircd --driver=$LIRC_DRIVER --device=$LIRC_DEVICE
-
- exit 0
-